<?php
/**
 * @ Fmash Top System
 * @ version: 3.0
 * @ author: i.coffee.smile@mail.com
 * @ date:2011-1-27
 * @ file:sumbit_tag.php $18
 */
 
session_start();
include_once 'class_mysql.php';
include_once 'cookie.php';

$sid = incheck($_GET['id']);
$uid = incheck($_COOKIE['UID']);
$username = incheck($_COOKIE['Uname']);

if($_SESSION['lasttag']==$_POST['tag'])
{
	$error = rawurlencode('对不起，请不要连续提交！');
	header("location:error.php?error=$error");
	exit();
}

if(isset($_POST['tag']))
{
	$tag = incheck($_POST['tag']);
	$time = time();
	$sql = "INSERT INTO `$top_man_tag` (`sid`, `tag`, `creater`, `datetime`) ";
	$sql.= " VALUES ('$sid', '$tag','$username', $time);";
	mysql_query($sql);
	$_SESSION['lasttag'] = $tag;
}

header("location:tag.php?id=$sid");